import request from '@/utils/request'
import Qs from 'qs'

export function doGet(url,query) {
  return request({
    url: url,
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}
export function doPost(url,data) {
  return request({
    url: url,
    method: 'post',
    data
  })
}

export function doFile(url,data) {
  return request({
    url: url,
    method: 'post',
    headers:{'Content-Type':'multipart/form-data'},
    data
  })
}

export function doForm(url,data) {
  return request({
    url: url,
    method: 'post',
    headers:{'Content-Type':'application/x-www-form-urlencoded'},
    params:data,
  })
}
